<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.zpyr.mvc.vo.Carc_evaluation"%>
<%@page import="java.util.List"%>
<%@page import="com.zpyr.mvc.vo.Carc_info"%>
<%@page import="com.zpyr.common.StringUtil"%>
<!DOCTYPE html>
<html>
<head>
<%
	Carc_info carc_info =(Carc_info) request.getAttribute("carc_info");
	List<Carc_evaluation> eval_list = (List<Carc_evaluation>) request.getAttribute("eval_list");
	String info_seq = "";
	String carc_name = "";
	String carc_desc = "";
	String description = "";
	String detail_desc = "";
	String phone = "";
	String working_time = "";
	String addr = "";
	int    grade_count = 0;
	int	   grade_total = 0;
	double grade_avg = 0.0;
	String lat = "" , lng = "";
	if(carc_info != null) {
		info_seq = StringUtil.nvl( carc_info.getInfo_seq() );
		carc_name = StringUtil.nvl( carc_info.getName() );
		carc_desc = StringUtil.nvl( carc_info.getDescription() );
		description = carc_info.getDescription();
		detail_desc = StringUtil.textTOhtml( carc_info.getDetail_desc() );
		phone = carc_info.getPhone();
		working_time = carc_info.getWorkTime();
		addr = carc_info.getAddr();
		grade_count = carc_info.getIgrade_total_count();
		grade_total = carc_info.getIgrade_total_point();
		grade_avg   = carc_info.getAvgGrade();
		lat = carc_info.getLat();
		lng = carc_info.getLng();
	}
	else {
		carc_name = "정비소 이름";
	}
	
%>
<title><%=carc_name %></title>
<script>
	$(document).ready(function(){
		
		
	});

</script>
<style>

</style>
</head>
<body>

<div id="header" class="header">
<span style=""><%=carc_name %></span>
<span id="mapBtn" class="button1" style="float:right;" onclick="goCarcenterInfoMap('<%=info_seq%>' , '<%=lat %>' , '<%=lng %>');";>지도보기</span>
<span id="favBtn" class="button1" style="float:right; margin-right: 3px;" onclick="addFavorite('<%=info_seq%>' , '<%=carc_name%>');">즐겨찾기</span>
</div>

<div id="main">
	<div class="content1">
		<h3>소개</h3>
		<br />
		<div><%=detail_desc %></div>
	</div>

	<div class="content1">
		<h3>기본정보</h3>
		<table>
		<colgroup>
		<col width="90px"  >
		<col >
		</colgroup>
		<tr>
		<td>전화</td>
		<td><%= phone%></td>
		</tr>
		<tr>
		<td>영업시간 </td>
		<td><%= working_time %> </td>
		</tr>
		<tr>
		<td>주소</td>
		<td><%= addr %></td>
		</tr>
		</table>
	</div>
	
	<div class="content2" onclick="goCarcenterEvaluationPage('<%=info_seq%>');">
		<h3>평가 -（<%= grade_count %>）개<span style="float:right; padding:1px;" ><%= grade_avg %></span></h3>
		<div style="width:100%; padding-bottom: 20px;">
			<div style="width:100%;" id="carc_info_evaluation_div" >
			<ul>
<%
	if(eval_list != null) {
		int i = 1;
		for(Carc_evaluation eval : eval_list) {
%>			
				<li>
				<br />
				<%=StringUtil.textTOhtml( eval.getContent() ) %>	
				<br /><br /><hr />
				<strong><label style="color: #ee3355;"><%=eval.getGrade() %></label> / 10</strong>
				<strong style="margin-right: 10px; float:right;">
				<img src="/images/icons/user3.png" width="10px;" />
				<%=eval.getWriter_name() %></strong>
				<hr size="5" />
				</li>
<% 			
			if( i == 2) break;
			i++;
		}
	}
%>
				</ul>
			</div>
		</div>
	</div>
</div>
</body>
</html>